package com.lib.common.adapter;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.ArrayList;

/**
 * @author FengLing
 *         Created on 2017-05-15 12:37
 */
public class FragmentBaseAdapter extends FragmentPagerAdapter {
	
	private final ArrayList<? extends Fragment> mFragList;
	
	public FragmentBaseAdapter(ArrayList<? extends Fragment> fragList, FragmentManager fm) {
		
		super(fm);
		mFragList = fragList;
	}
	
	@Override
	public Fragment getItem(int position) {
		
		return mFragList.get(position);
	}
	
	@Override
	public int getCount() {
		
		return mFragList == null ? 0 : mFragList.size();
	}
}